3.2.66 \(\int \frac {A+B x}{x^2 (a+b x)} \, dx\)

Optimal. Leaf size=43 \[ -\frac {\log (x) (A b-a B)}{a^2}+\frac {(A b-a B) \log (a+b x)}{a^2}-\frac {A}{a x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {77} \begin {gather*} -\frac {\log (x) (A b-a B)}{a^2}+\frac {(A b-a B) \log (a+b x)}{a^2}-\frac {A}{a x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x)/(x^2*(a + b*x)),x]

[Out]

-(A/(a*x)) - ((A*b - a*B)*Log[x])/a^2 + ((A*b - a*B)*Log[a + b*x])/a^2

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin {align*} \int \frac {A+B x}{x^2 (a+b x)} \, dx &=\int \left (\frac {A}{a x^2}+\frac {-A b+a B}{a^2 x}-\frac {b (-A b+a B)}{a^2 (a+b x)}\right ) \, dx\\ &=-\frac {A}{a x}-\frac {(A b-a B) \log (x)}{a^2}+\frac {(A b-a B) \log (a+b x)}{a^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 42, normalized size = 0.98 \begin {gather*} \frac {\log (x) (a B-A b)}{a^2}+\frac {(A b-a B) \log (a+b x)}{a^2}-\frac {A}{a x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x)/(x^2*(a + b*x)),x]

[Out]

-(A/(a*x)) + ((-(A*b) + a*B)*Log[x])/a^2 + ((A*b - a*B)*Log[a + b*x])/a^2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A+B x}{x^2 (a+b x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(A + B*x)/(x^2*(a + b*x)),x]

[Out]

IntegrateAlgebraic[(A + B*x)/(x^2*(a + b*x)), x]

________________________________________________________________________________________

fricas [A]  time = 1.42, size = 41, normalized size = 0.95 \begin {gather*} -\frac {{\left (B a - A b\right )} x \log \left (b x + a\right ) - {\left (B a - A b\right )} x \log \relax (x) + A a}{a^{2} x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x^2/(b*x+a),x, algorithm="fricas")

[Out]

-((B*a - A*b)*x*log(b*x + a) - (B*a - A*b)*x*log(x) + A*a)/(a^2*x)

________________________________________________________________________________________

giac [A]  time = 0.95, size = 51, normalized size = 1.19 \begin {gather*} \frac {{\left (B a - A b\right )} \log \left ({\left | x \right |}\right )}{a^{2}} - \frac {A}{a x} - \frac {{\left (B a b - A b^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{a^{2} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x^2/(b*x+a),x, algorithm="giac")

[Out]

(B*a - A*b)*log(abs(x))/a^2 - A/(a*x) - (B*a*b - A*b^2)*log(abs(b*x + a))/(a^2*b)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 51, normalized size = 1.19 \begin {gather*} -\frac {A b \ln \relax (x )}{a^{2}}+\frac {A b \ln \left (b x +a \right )}{a^{2}}+\frac {B \ln \relax (x )}{a}-\frac {B \ln \left (b x +a \right )}{a}-\frac {A}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)/x^2/(b*x+a),x)

[Out]

-A/a/x-1/a^2*ln(x)*A*b+1/a*ln(x)*B+1/a^2*ln(b*x+a)*A*b-1/a*ln(b*x+a)*B

________________________________________________________________________________________

maxima [A]  time = 0.96, size = 43, normalized size = 1.00 \begin {gather*} -\frac {{\left (B a - A b\right )} \log \left (b x + a\right )}{a^{2}} + \frac {{\left (B a - A b\right )} \log \relax (x)}{a^{2}} - \frac {A}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x^2/(b*x+a),x, algorithm="maxima")

[Out]

-(B*a - A*b)*log(b*x + a)/a^2 + (B*a - A*b)*log(x)/a^2 - A/(a*x)

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 33, normalized size = 0.77 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {2\,b\,x}{a}+1\right )\,\left (A\,b-B\,a\right )}{a^2}-\frac {A}{a\,x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x)/(x^2*(a + b*x)),x)

[Out]

(2*atanh((2*b*x)/a + 1)*(A*b - B*a))/a^2 - A/(a*x)

________________________________________________________________________________________

sympy [B]  time = 0.40, size = 95, normalized size = 2.21 \begin {gather*} - \frac {A}{a x} + \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} - a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} - \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a b + B a^{2} + a \left (- A b + B a\right )}{- 2 A b^{2} + 2 B a b} \right )}}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x**2/(b*x+a),x)

[Out]

-A/(a*x) + (-A*b + B*a)*log(x + (-A*a*b + B*a**2 - a*(-A*b + B*a))/(-2*A*b**2 + 2*B*a*b))/a**2 - (-A*b + B*a)*
log(x + (-A*a*b + B*a**2 + a*(-A*b + B*a))/(-2*A*b**2 + 2*B*a*b))/a**2

________________________________________________________________________________________